
const App = getApp()
Page({
  data: {
    grzx: App.myUlife.ulifeUrl+ '/wx/grzx.jpg',
    ulifeUrl: App.myUlife.ulifeUrl,


    zxkfImga: App.myUlife.ulifeUrl + '/wx/zxkf_dh.png',
    zxkfImgb: App.myUlife.ulifeUrl + '/wx/zxkf_wx.png',

    // mode: ['拨打电话 100 1000 1000', '联系微信 100 1000 1000'],
    zxkfArray: [
      {
        "zxkfText": '拨打电话 ',
        "zxkfPath": '1302780838',
        "zxkfImg": App.myUlife.ulifeUrl + '/wx/zxkf_dh.png',
        "zxkfbindtap": "calling"
      },
      {
        "zxkfText": '联系微信',
        "zxkfPath": 'ZYB10788888888',
        "zxkfImg": App.myUlife.ulifeUrl + '/wx/zxkf_wx.png',
        "zxkfbindtap": ""
      }
    ],

  },

  onLoad: function () {
    var that = this;
    var openid = wx.getStorageSync('openid');

    if (openid == "") {
      wx.redirectTo({
        url: '../../pages/index/index'
      })
    } else {
      var userInfo = {
        city: wx.getStorageSync('city'),
        province: wx.getStorageSync('province'),
        gender: wx.getStorageSync('gender'),
        nickName: wx.getStorageSync('nickName'),
        avatarUrl: wx.getStorageSync('avatarUrl'),
        openid: wx.getStorageSync('openid')
      }
      that.setData({
        userInfo: userInfo
      });
    }
  },


  //打电话
  calling: function () {
    wx.makePhoneCall({
      phoneNumber: '1302780838', //此号码并非真实电话号码，仅用于测试
      success: function () {
        console.log("拨打电话成功！")
      },
      fail: function () {
        console.log("拨打电话失败！")
      }
    })
  }

})